/**
 * @标题：服务
 * @描述：描述一个可以操作用户联系详情的服务
 * @author: 李东峻
*  @version V1.0, 2015/1/28
 */
package com.linkage.service.consumer;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.linkage.pojo.consumer.ContactDetail;
import com.linkage.repository.consumer.ContactDetailsRepository;
@Service
public class EditContactDetailsService {
	@Autowired
	private ContactDetailsRepository  contactDetailsRepository;
	
	public void editContactDetails(ContactDetail ContactDetail){
		this.contactDetailsRepository.editContactDetails(ContactDetail);
	}
	
	public void addContactDetails(ContactDetail contactDetail){
		this.contactDetailsRepository.addContactDetails(contactDetail);
	}
	
	public void deleteContactDetails(@Param("shoppingContactId") Integer shoppingContactId){
		this.contactDetailsRepository.deleteContactDetails(shoppingContactId);
	}
	
	public void setdefaultContactDetails(Integer shoppingContactId){
		this.contactDetailsRepository.setdefaultContactDetails(shoppingContactId);
	}

    public List<ContactDetail> listAllContactDetail(Integer userId){
        return this.contactDetailsRepository.listAllContactDetail(userId);
    }

    public ContactDetail selectOneContactDetailById(@Param("shoppingContactId") Integer shoppingContactId){
        return this.contactDetailsRepository.selectOneContactDetailByshoppingContactId(shoppingContactId);
    }

    public List<ContactDetail> selectContactDetailByUserId(@Param("userId") Integer userId){
        
        return this.contactDetailsRepository.selectContactDetailByUserId(userId);
        
    }

    public ContactDetail selectDefaultContactDetail(Integer userId){
        
        return this.contactDetailsRepository.selectDefaultContactDetail(userId);
    }
        
}
